Holux changes from Jochen
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 20 Sep 2002 15:07:17 +0000 (15:07 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 20 Sep 2002 15:07:17 +0000 (15:07 +0000)
gpsbabel/holux.c
gpsbabel/holux.h

index 9d87f0127b557bd12a85ece3334ce4e3b3ce6270..2bcff3c79a75a643d350cd6661211eafce30dc08 100644 (file)
@@ -126,7 +126,7 @@ static void data_read(void)
                wpt_tmp->creation_time = 0;
         if (pWptHxTmp->date.year)
         {
-            ptm = gmtime(&pWptHxTmp->time);
+            ptm = gmtime((time_t*)&pWptHxTmp->time);
                    tm.tm_hour = ptm->tm_hour; 
             tm.tm_min = ptm->tm_min;
                    tm.tm_sec = ptm->tm_sec;
@@ -189,7 +189,9 @@ static void holux_disp(const waypoint *wpt)
 
     sIndex =  ((WPTHDR *)HxWFile)->num;
     ((WPTHDR *)HxWFile)->idx[sIndex] = sIndex;         /* set the waypoint index  */
+    ((WPTHDR *)HxWFile)->used[sIndex] = 0xff;           /* Waypoint used */ 
  
+
     /* set Waypoint */
     pWptHxTmp =  (WPT *)&HxWFile[OFFS_WPT + (sizeof(WPT) * sIndex)];
 
@@ -206,7 +208,7 @@ static void holux_disp(const waypoint *wpt)
     /*set the time */
        if (wpt->creation_time) 
     {
-        /* tm = gmtime(&wpt->creation_time);  /* I get the wrong result with gmtime ???  */
+        /* tm = gmtime(&wpt->creation_time);*/  /* I get the wrong result with gmtime ???  */
         tm = localtime(&wpt->creation_time);
         pWptHxTmp->time = (tm->tm_hour * 3600) + (tm->tm_min * 60) +tm->tm_sec;
        pWptHxTmp->date.day = tm->tm_mday; 
@@ -225,9 +227,9 @@ static void holux_disp(const waypoint *wpt)
     pWptHxTmp->pt.iLatitude = (int)lat;
     pWptHxTmp->pt.iLongitude = (int)lon;
     pWptHxTmp->checked = 01;
-
+    pWptHxTmp->vocidx = (short)0xffff;
     ((WPTHDR *)HxWFile)->num = ++sIndex;
-    ((WPTHDR *)HxWFile)->next= sIndex;
+    ((WPTHDR *)HxWFile)->next= ++sIndex;
 }
 
 
@@ -248,7 +250,7 @@ static void data_write(void)
     
     /* clear index list */
     for (sCount = 0; sCount < MAXWPT; sCount++)
-        ((WPTHDR *)HxWFile)->idx[sCount] = (short)0xffff
+        ((WPTHDR *)HxWFile)->idx[sCount] = (signed short)-1
     for (sCount = 0; sCount < MAXWPT; sCount++)
         ((WPTHDR *)HxWFile)->used[sCount] = 0; 
 
@@ -256,13 +258,13 @@ static void data_write(void)
    /* init the route area */
     ((RTEHDR *)&HxWFile[ROUTESTART])->id = RTE_HDR_ID;
     ((RTEHDR *)&HxWFile[ROUTESTART])->num = 0;
-    ((RTEHDR *)&HxWFile[ROUTESTART])->next = 0;
-    ((RTEHDR *)&HxWFile[ROUTESTART])->rteno = 0;
+    ((RTEHDR *)&HxWFile[ROUTESTART])->next = 1;
+    ((RTEHDR *)&HxWFile[ROUTESTART])->rteno = (signed short)-1;
     
     /* clear index list */
-    for (sCount = 0; sCount < MAXWPT; sCount++)
-        ((RTEHDR *)&HxWFile[ROUTESTART])->idx[sCount] = (short)0xffff
-    for (sCount = 0; sCount < MAXWPT; sCount++)
+    for (sCount = 0; sCount < MAXRTE; sCount++)
+        ((RTEHDR *)&HxWFile[ROUTESTART])->idx[sCount] = (signed short)-1
+    for (sCount = 0; sCount < MAXRTE; sCount++)
         ((RTEHDR *)&HxWFile[ROUTESTART])->used[sCount] = 0; 
 
 
index 25fb2af5bfec19266cced092e214061033b65c28..cab9e077c58970a40a4576ec29b472e3e4fe2681 100644 (file)
@@ -33,7 +33,8 @@
 #endif
 
 
-#define GM100_WPO_FILE_SIZE 25512       /* size of a holux gm-100 wpo file */ 
+/* #define GM100_WPO_FILE_SIZE 25512 */      /* size of a holux gm-100 wpo file used by mapShow 1.4*/ 
+#define GM100_WPO_FILE_SIZE 25600       /* size of a holux gm-100 wpo file used by the GM-100*/ 
 
 #define ROUTESTART         23600           /* Offset for start of route */
 #define MAXWPT             500             /* max number of waypoint */
@@ -84,7 +85,7 @@ typedef struct tagWPT
        POINT    pt;                                    /* waypoint location  */
        short    vocidx;                                    /* voice index, not used */
        short    usecount;                              /* counter: times used by routes */
-       HX_DATE     date;                                   /* date */
+       HX_DATE     date;                               /* date */
        unsigned time;                              /* time      */
        char     checked;                                   /* Active or not */
     BYTE     dummy[3];                  /* fill bytes */
@@ -94,12 +95,12 @@ typedef struct tagWPT
 
 typedef  struct tagRTEHDR
 {
-       DWORD       id;                              /* RTE_HDR_ID */
-       short           num;                             /* Current route number */
-       short           next;                            /* next route number */
-       short           idx[MAXRTE];             /* saving route index here for each route, default was -1  */
-       BYTE            used[MAXRTE];            /* Have the wpt been used (0xFF), Default was 0 */
-       short           rteno;                           /* Saving navigationroute number here */
+       DWORD           id;                                  /* RTE_HDR_ID */
+       short               num;                                 /* Current route number */
+       short               next;                                /* next route number */
+       signed short    idx[MAXRTE];             /* saving route index here for each route, default was -1  */
+       BYTE                used[MAXRTE];                /* Have the wpt been used (0xFF), Default was 0 */
+       signed short    rteno;                           /* Saving navigationroute number here */
 }RTEHDR;